<!doctype html>
<html>

<head>
  <title>TestApp1 - TestApp1.html</title>
  <meta charset="UTF-8">
  <meta name="Author" content="setycyas">
  <link rel="stylesheet" href="/static/bootstrap.min.css" type="text/css" />
  <link rel="stylesheet" href="/static/common_style.css" type="text/css" />
  <!--common_style.css是自定义的基本模板页css,每个应用还应该自定义一个css-->
  <script src="/static/jquery.min.js"></script>
  <!--<script src="bootstrap.min.js"></script>-->
  <script src="/static/poster.js"></script>
  <script>
  
    var simplePoster1 = new SimplePoster(
      'TestApp1',
      'postTest1',
      (respData) => {
        $("#postRespon1").html(respData['result']);
      }
    );
  
    var threadObserver1 = new ThreadObserver(
      'TestApp1',
      'TestThread1',
      1000,
      (status) => {
        $('#threadStatus1').html(status['status']['msg']);
      },
      (status) => {
        var s = '计时线程结束:code = '+status['code']+';result = ';
        s += status['result']+';error = '+status['error']
        $('#threadStatus1').html(s);
      }
    );
    
    function testBtn1Click(){
    
      simplePoster1.post({
        'string': '这是从TestApp1发上来的post',
        'times': '9'
      });
      
      threadObserver1.start();
    }
      
  </script>
</header>

<body><div class='container'>
  <h2>TestApp1</h2>
  <input id="testBtn1" class='btn btn-primary' type="button" 
    value="测试1" onclick="testBtn1Click();" /><br/>
  <label id="postRespon1" class="control-label">post的返回显示</label><br/>
  <label id="threadStatus1" class="control-label">线程的状态显示</label>
</div></body>

</html>